﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

namespace RAP.Framework.Libary.DataSource.Model
{
    /// <summary>
    /// 数据实体标识接口，用来标识当前对象为数据实体类型
    /// </summary>
    public interface IDataModel : IDisposable
    {
        /// <summary>
        /// 获取上下文对象
        /// </summary>
        DataParseContext GetContext ();

        /// <summary>
        /// 设置上下文
        /// </summary>
        /// <param name="context"></param>
        void SetContext ( DataParseContext context );

        /// <summary>
        /// 获取已缓存的懒加载数据，防止一个实体的懒加载属性或函数被多次加载或执行
        /// </summary>
        /// <param name="methodName"></param>
        /// <returns></returns>
        object GetCachedLazyloadValue ( string methodName );

        /// <summary>
        /// 缓存懒加载的数据
        /// </summary>
        /// <param name="methodName"></param>
        /// <param name="value"></param>
        void CacheLazyloadValue ( string methodName, object value );
    }
}
